\name{f.r2}
\alias{f.r2}
\title{Calculate an F-test and p-value from an R^2 and DF}
\description{Calculates an F-test from an R^2 value and the degrees of freedom for the model the R^2 was based on.}
\usage{
f.r2(r2, numdf, dendf)
}
\arguments{
  \item{r2}{\eqn{R^2}{R^2} value.}
  \item{numdf}{The numerator degrees of freedom for the F-test.  Typically the number of explanatory variables in the model.}
  \item{dendf}{The denominator degrees of freedom for the F-test.  Typically the residual or \eqn{n - k - 1}{n - k - 1} where k is the number of explanatory variables.}
}
\value{A named vector of with the F-value, the numerator DF, the denominator DF, and the p-value.}
\author{Joshua Wiley, \url{http://joshuawiley.com/}}
\examples{
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(r2, numdf, dendf) {
  F <- (dendf/numdf) * (-r2/(r2 - 1))
  p <- pf(F, df1 = numdf, df2 = dendf, lower.tail = FALSE)
  c(F = F[[1]], numdf, dendf, p = p[[1]])
  }
}
\keyword{htest}
